public class homework12{
    public static int [] findMaxElement ( int arr[]) {
        int max = arr[0];
        int position = 0;
        for (int i = 1; i < arr.length; i++) {
            if (max < arr[i]) {
                max = arr[i];
                position = i;
            }
        }
        return new int[]{max, position};
    }
            public static void main (String[]args ){

            int[] arr = {15, 7, 66, 99, 10, 2, 4};
            arr = findMaxElement(arr);
            System.out.println("数组中最大的数字为" + arr[0]);
            System.out.println("数组中最大数字的位置是" + arr[1]);
        }
    }